﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AdmLaboratorios.DTO;
using System.Data.SqlClient;
using System.Data;

namespace AdmLaboratorios.DAO
{
    public class InformeLaboratorioDAO : DAOBase<InformeLaboratorioDTO>
    {
        public DataTable Consulta(string filtro)
        {
            string qry = @"SELECT * 
                            FROM [InformeLaboratorio] CC
                            JOIN [Stock] S ON CC.IdStock = S.Id
                            JOIN [Producto] P ON S.IdProducto = P.Id
                            JOIN [Usuario] U ON CC.IdOperador = U.Id";

            if (filtro.Trim() != string.Empty)
                qry = qry + " WHERE " + filtro;

            return GetTable(qry);
        }
    }
}
